import service from "@/utils/request";

export function changeAvatar(avatar: string) {
  const data = {
    avatar
  };
  return service({
    url: "/user/changeAvatar",
    method: "post",
    data,
    headers: {
      isToken: true
    }
  });
}

export function queryUserInfo() {
  return service({
    url: "/user/query",
    method: "get",
    headers: {
      isToken: true
    }
  });
}

export function queryUserById(user: number) {
  return service({
    url: "/user/getById",
    method: "get",
    headers: {
      isToken: true
    },
    params: {
      user
    }
  });
}
